home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pdox35sc.zip / PRINTER.SC < prev    next >
Text File  |  1991-06-10  |  50KB  |  915 lines

  1. ; ***************************************************************************************
  2. ;                               GENERIC PRINTING UTILITY
  3.  
  4. ; Copyright 1991   Virginia B. Sauer   All Rights Reserved
  5. ; This program may be copied/modified without charge provided both that this
  6. ; copyright notice is included without change, and that any accompanying
  7. ; documentation includes the notice "Portions of code (c) Copyright 1991,
  8. ; Virginia B. Sauer"
  9. ; ***************************************************************************************
  10.  
  11.  
  12. ; When creating applications, it is often impossible to know which printer(s) will be
  13. ; utilized ... Even when such information is readily available, printers can be changed,
  14. ; systems run at multiple locations, and designations varied on multi-user LAN versions.
  15.  
  16. ; Apart from the inconvenience of individually updating reports, many novices are
  17. ; unfamiliar with the necessary procedures.
  18.  
  19. ; To forestall such problems, the following utility has been developed to walk the user
  20. ; through automatically designating and modifying all printer settings, ensuring that the
  21. ; printer is online, et cetera.  As this is completely generic, it can effortlessly be
  22. ; incorporated into any application you design.
  23.  
  24.  
  25. ;                      ************  IMPORTANT NOTE  ************
  26.  
  27. ;  This utility also requires a special table and data entry form.  Such procedures are
  28. ;  clearly outlined in your Paradox manual.  As this column is intended to provide a
  29. ;  generic utility (rather than an introduction to Paradox), space constraints preclude
  30. ;  citing step-by-step procedures herein.  Nevertheless, for the sake of novices (and to
  31. ;  ensure that this utility is presented in its entirety), a program is included to
  32. ;  automatically create all necessary tables, forms, validity checks, et cetera.
  33.  
  34.  
  35. ; ********************************************************************************
  36. ;  To invoke this procedure, you will need to create a table named Printer, with
  37. ;  with the following structure.  (As explained in the introduction, procedures are
  38. ;  outlined in your Paradox manual, and a program to automatically create the table
  39. ;  [replete with validity checks] is included beneath the sample.)
  40. ; ********************************************************************************
  41.  
  42. ;  ╔═════════════════════════════════════════════════════════════════════════════════════╗
  43. ;  ║                           P R I N T E R    T A B L E                                ║
  44. ;  ╟───────────────┬──────┬─────────┬────────────────────────────────┬───────────────────╢
  45. ;  ║               │      │         │                                │    Description    ║
  46. ;  ║   Field Name  │ Type │ Default │    Validity Check (Picture)    │         of        ║
  47. ;  ║               │      │         │                                │  Validity Check   ║
  48. ;  ╠═══════════════╪══════╪═════════╪════════════════════════════════╪═══════════════════╣
  49. ;  ║               │      │         │                                │ Proper case (cap- ║
  50. ;  ║ [NAME]        │ A38* │         │ !*[{ ,-[ ],.[ ],;,[ ]}!,@]     │ italize first let ║
  51. ;  ║               │      │         │                                │ ter of each word) ║
  52. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  53. ;  ║               │      │         │                                │    landscape      ║
  54. ;  ║ [ORIENTATION] │ A9*  │         │ {landscape,portrait}           │        or         ║
  55. ;  ║               │      │         │                                │     portrait      ║
  56. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  57. ;  ║               │      │         │                                │  condensed,       ║
  58. ;  ║ [PITCH]       │ A9*  │         │ {condensed,elite,pica}         │  elite, or pica   ║
  59. ;  ║               │      │         │                                │  type             ║
  60. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  61. ;  ║ [LENGTH]      │ A2   │         │ *#                             │  All numbers      ║
  62. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  63. ;  ║               │      │         │                                │  All capital      ║
  64. ;  ║ [PORT]        │ A4   │  LPT1   │ *!                             │  letters          ║
  65. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  66. ;  ║               │      │         │                                │  All numbers and  ║
  67. ;  ║ [SETUP]       │ A30  │         │ *{!, }                         │  capitalized      ║
  68. ;  ║               │      │         │                                │  letters          ║
  69. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  70. ;  ║ [PICK]        │ A1   │         │ X                              │       X           ║
  71. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  72. ;  ║               │      │         │                                │  Dot Matrix,      ║
  73. ;  ║ [TYPE]        │ A10  │         │ {Dot Matrix,Ink Jet,Laser Jet} │  Ink Jet, or      ║
  74. ;  ║               │      │         │                                │  Laser Jet        ║
  75. ;  ║───────────────┼──────┼─────────┼────────────────────────────────┼───────────────────╢
  76. ;  ║ [CODE]        │ A1   │         │ *#                             │  All numbers      ║
  77. ;  ╚═══════════════╧══════╧═════════╧════════════════════════════════╧═══════════════════╝
  78.  
  79. ;  ----- Invoke the following procedures ONLY if you want to automatically create the
  80. ;        above table and validity checks ... They will not be used in the actual printer
  81. ;        utility
  82.  
  83.    If not Istable("Printer")
  84.       Then Create "Printer"
  85.            "NAME"        : "A38*",
  86.            "ORIENTATION" : "A9*" ,
  87.            "PITCH"       : "A9*" ,
  88.            "LENGTH"      : "A2"  ,
  89.            "PORT"        : "A4"  ,
  90.            "SETUP"       : "A30" ,
  91.            "PICK"        : "A1"  ,
  92.            "TYPE"        : "A10" ,
  93.            "CODE"        : "A1"
  94.            Edit "PRINTER"
  95.               {ValCheck} {Define} Enter {Picture} {!*[{ ,-[ ],.[ ],;,[ ]\}!,@]}  Enter
  96.               {ValCheck} {Define} Enter {Picture} {landscape,portrait}           Enter
  97.               {ValCheck} {Define} Enter {Picture} {condensed,elite,pica}         Enter
  98.               {ValCheck} {Define} Enter {Picture} {*#}                           Enter
  99.               {ValCheck} {Define} Enter {Picture} {*!}
  100.               {ValCheck} {Define} Enter {Default} {LPT1}                         Enter
  101.               {ValCheck} {Define} Enter {Picture} {*{!, \}}                       Enter
  102.               {ValCheck} {Define} Enter {Picture} {X}                            Enter
  103.               {ValCheck} {Define} Enter {Picture} {Dot Matrix,Ink Jet,Laser Jet} Enter
  104.               {ValCheck} {Define} Enter {Picture} {*#}                           Enter
  105.               Del                        ;- Delete record created by default value
  106.            Do_It!
  107.  
  108. ;  ----- Modify this segment to incorporate the printer configurations required by your
  109. ;        application.
  110.  
  111. ;        For example, whereas a complete system would offer all options (landscape and
  112. ;        portrait modes, every pitch, et cetera), such an array would prove confusing in
  113. ;        a runtime version designed solely for 16.6H characters per inch).
  114.  
  115. ;        Likewise, if you know which printer(s) will be used by the end user, make
  116. ;        certain to incorporate their names and setup strings in the Printer table.
  117.  
  118.       Edit "Printer"
  119.          "Hewlett Packard Laser Jet Series I"    Down        ; Enter names of all
  120.          "Hewlett Packard Laser Jet Series II"   Down        ; printers "known" to
  121.          "Hewlett Packard Laser Jet Series II-P" Down        ; be used by your end
  122.          "Hewlett Packard Laser Jet Series III"  Down        ; user
  123.          "IBM-Compatible Dot Matrix Printer"     Home Right  ; Move to next field
  124.          "P"                                     Right       ; Autofill portrait
  125.          "C"                                     Right       ; Autofill condensed
  126.          "80"                                    Right       ; Length
  127.          "LPT1"                                  Right       ; Port
  128.          "\\027E\\027(s16.66H\\027&l8D"          Right Right ; Setup ... Skip "Pick"
  129.          "L"                                     End         ; Autofill Laser Jet
  130.          "D"                                     Left Left   ; Autofill Dot Matrix
  131.          "\\027W\\000\\015"                      Home        ; Setup for Dot Matrix
  132.          For Counter from 1 to Nfields("Printer")            ; Copy preceding field values
  133.             Scan for Isblank([])                             ; where applicable
  134.                Ditto
  135.             Endscan
  136.             Right
  137.          Endfor
  138.       Do_It!
  139.    Endif
  140.  
  141. ;  ********************************************************************************
  142. ;  After creating the aforementioned table, design a data entry form.  (As stated
  143. ;  in the introduction, procedures are outlined in your Paradox manual, and a
  144. ;  program to automatically create the form is included beneath the sample.)
  145. ;  ********************************************************************************
  146.  
  147. ;  ╔══════════════════════════════════════════════════════════════════════════════╗
  148. ;  ║            PRINTER NAME:  ______________________________________             ║
  149. ;  ║                                   (e. g., Epson FX-286E)                     ║
  150. ;  ║─────────────────────────────┬────────────────────────────┬───────────────────║
  151. ;  ║   REPORT PAGE LENGTH:  __   │  PRINTER TYPE: __________  │   PORT:  ____     ║
  152. ;  ║  (Check your printer guide) │ (Dot Matrix/Laser/Ink Jet) │  Default = LPT1   ║
  153. ;  ║─────────────────────────────┴────────────────────────────┴───────────────────║
  154. ;  ║                                                                              ║
  155. ;  ║      SETUP STRING:  __________________________________________________       ║
  156. ;  ║                                                                              ║
  157. ;  ║   Setup strings can be found in the manual that accompanied your printer.    ║
  158. ;  ║                                                                              ║
  159. ;  ║             If you have a laser jet or IBM-compatible printer with          ║
  160. ;  ║              graphics capability, please specify the appropriate             ║
  161. ;  ║              graphics-quality escape sequence for your printer.              ║
  162. ;  ║                                                                              ║
  163. ;  ║             If your printer does not have graphics capability,              ║
  164. ;  ║              specify the string for your printer.  (The reports will         ║
  165. ;  ║              then be printed without graphics characters or boxes.)          ║
  166. ;  ║                                                                              ║
  167. ;  ║──────────────────────────────────────────────────────────────────────────────║
  168. ;  ║      Press the <F2> key when finished, or the <Esc> key to quit      ║
  169. ;  ╚══════════════════════════════════════════════════════════════════════════════╝
  170.  
  171. ;  ----- Invoke the following procedures ONLY if you want to automatically design the
  172. ;        above form ... They will not be used in the actual printer utility
  173.    If not IsFile("Printer.F1")
  174.       Then Proc Position_Cursor(Rownum,Colnum)
  175.          Home CtrlHome
  176.          While Rowno() < Rownum Down  Endwhile
  177.          While Colno() < Colnum Right Endwhile
  178.       Endproc
  179.       Proc Place_Border(LineType)
  180.          LineType = LineType + "-Line"
  181.          {Border} {Place} Select LineType Enter
  182.       Endproc
  183.       {Forms} {Design} {PRINTER} {1} {ENTER PRINTER CODES}
  184.          Place_Border("Double") Position_Cursor(23,80) Enter
  185.          Position_Cursor(04,02) Place_Border("Single") Position_Cursor(04,79) Enter
  186.          Position_Cursor(07,02) Place_Border("Single") Position_Cursor(07,79) Enter
  187.          Position_Cursor(21,02) Place_Border("Single") Position_Cursor(21,79) Enter
  188.          Position_Cursor(05,31) Place_Border("Single") Down Enter
  189.          Position_Cursor(06,31) Enter
  190.          Position_Cursor(05,60) Place_Border("Single") Down Enter
  191.          Position_Cursor(06,60) Enter
  192.          Position_Cursor(04,31) Typein "\194" Position_Cursor(04,60) Typein "\194"
  193.          Position_Cursor(07,31) Typein "\193" Position_Cursor(07,60) Typein "\193"
  194.          Position_Cursor(02,14) Typein "PRINTER NAME:  "
  195.                                 {Field} {Place} {Regular} {NAME} Enter Enter
  196.          Position_Cursor(03,37) Typein "(e. g., Epson FX-286E)"
  197.          Position_Cursor(05,05) Typein "REPORT PAGE LENGTH:  "
  198.                                 {Field} {Place} {Regular} {LENGTH} Enter Enter
  199.          Position_Cursor(05,34) Typein "PRINTER TYPE:  "
  200.                                 {Field} {Place} {Regular} {TYPE} Enter Enter
  201.          Position_Cursor(05,64) Typein "PORT:  "
  202.                                 {Field} {Place} {Regular} {PORT} Enter Enter
  203.          Position_Cursor(06,04) Typein "(Check your printer guide)"
  204.          Position_Cursor(06,33) Typein "(Dot Matrix/Laser/Ink Jet)"
  205.          Position_Cursor(06,63) Typein "Default = LPT1"
  206.          Position_Cursor(09,08) Typein "SETUP STRING:  "
  207.                                 {Field} {Place} {Regular} {SETUP} Enter Enter
  208.          Position_Cursor(11,05)
  209.          Typein "Setup strings can be found in the manual that accompanied your printer."
  210.          Position_Cursor(13,11) Typein "\04"
  211.          Position_Cursor(13,16)
  212.          Typein "If you have a laser jet or IBM-compatible printer with"
  213.          Position_Cursor(14,16)
  214.          Typein "graphics capability, please specify the appropriate"
  215.          Position_Cursor(15,16)
  216.          Typein "graphics-quality escape sequence for your printer."
  217.          Position_Cursor(17,11) Typein "\04"
  218.          Position_Cursor(17,16)
  219.          Typein "If your printer does not have graphics capability,"
  220.          Position_Cursor(18,16)
  221.          Typein "specify the string for your printer.  (The reports"
  222.          Position_Cursor(19,16)
  223.          Typein "will then be printed without graphics characters or boxes.)"
  224.          Position_Cursor(22,03) Typein "     Press the <F2> key when finished,"
  225.                                        + " or the <Esc> key to quit     "
  226.       Do_It!
  227.    Endif
  228.  
  229. ;  --- If necessary, move the Printer table and form to the appropriate directory (e. g.,
  230. ;      if you place lookup tables in a subdirectory named LookUp, the Printer table would
  231. ;      probably belong there).  To accomplish this, follow the Paradox menu selections:
  232. ;      {Tools} {Rename} {Table} {Printer} {LookUp\\Printer}.
  233.  
  234. ;********************************************************************************
  235. ;                      THE PRINTER CONFIGURATION UTILITY BEGINS HERE
  236. ;********************************************************************************
  237.  
  238. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  239. ; ║                      PARAMETERS  PASSED  TO  THIS  PROCEDURE                         ║
  240. ; ║        (Unless these are variables, each must be enlosed in quotation marks.)        ║
  241. ; ╟───────────┬───────────────────────────────────────────────────────┬──────────────────╢
  242. ; ║  ARGUMENT │                     DESCRIPTION                       │      SAMPLE      ║
  243. ; ╟───────────┼───────────────────────────────────────────────────────┼──────────────────╢
  244. ; ║           │  The page orientation (vertical or horizontal):       │    "Portrait"    ║
  245. ; ║Orientation│      "Portrait" (to signify vertical as for a letter) │   (To signify    ║
  246. ; ║           │      "Landscape" (to signify horizontal, or sideways) │   vertical)      ║
  247. ; ╟───────────┼───────────────────────────────────────────────────────┼──────────────────╢
  248. ; ║           │  The number of characters to be printed per inch:     │     "Pica"       ║
  249. ; ║   Pitch   │      "Condensed" (for condensed pitch, 16.6 cpi)      │                  ║
  250. ; ║           │      "Elite"     (for elite pitch, 12 cpi)            │  (To print 10    ║
  251. ; ║           │      "Pica"      (for pica pitch, 10 cpi)             │  cpi)            ║
  252. ; ╟───────────┼───────────────────────────────────────────────────────┼──────────────────╢
  253. ; ║           │  The length of the paper to be used:                  │      "11"        ║
  254. ; ║PaperLength│      "11" (for letter-sized paper, 8 1/2 x 11 inches) │ (To signify paper║
  255. ; ║           │      "14" (for legal-sized paper, 8 1/2 x 14 inches)  │ 11 inches long)  ║
  256. ; ╟───────────┼───────────────────────────────────────────────────────┼──────────────────╢
  257. ; ║           │ The name of the printer table (e. g., "Printer", if   │    "Printer"     ║
  258. ; ║PrinterTbl │ it is in the current directory, or "Lookup\\Printer", │(To signify that  ║
  259. ; ║           │ if it is in a subdirectory named Lookup)              │printer table is  ║
  260. ; ║           │                                                       │named "Printer")  ║
  261. ; ╟───────────┼───────────────────────────────────────────────────────┼──────────────────╢
  262. ; ║           │ Whether or not the reports are to be printed at this  │      "Yes"       ║
  263. ; ║ PrintNow  │ time (as opposed to merely configuring the printer):  │ (To signify that ║
  264. ; ║           │      "Yes" (if reports are to be printed now)         │ reports are to   ║
  265. ; ║           │      "No"  (if reports are not to be printed now)     │ be printed now)  ║
  266. ; ╚═══════════╧═══════════════════════════════════════════════════════╧══════════════════╝
  267.  
  268. Release procs all Release vars all
  269. Run NoRefresh "Del Print.lib"           ; Ensure that the library exists
  270. Libname = "Print"                       ; (If desired, modify this segment to
  271. If not isfile(Libname + ".lib")         ; add the procedures to a library of
  272.    Then Createlib Libname               ; your choice, such as LIB\\Print if
  273. Endif                                   ; you use RDA.)
  274.  
  275. ; ---- Set up printer for the specified reports
  276. Proc Setup_Printer(Orientation,Pitch,PaperLength,PrinterTbl,PrintNow)
  277.    While true
  278.       Configure_Printer()
  279.       If Upper(PrintNow) = "YES"        ; If ready to print now (rather than
  280.          Then Check_Printer()           ; just configuring printer)
  281.       Endif
  282.       Quitloop
  283.    EndWhile
  284. Endproc
  285. Writelib Libname Setup_Printer
  286. Release procs Setup_Printer
  287. ?? ""
  288.  
  289. ; ---- change/assign default configurations
  290. Proc Select_Printer()
  291.    Private Choice                       ;- user's choice
  292.    Clear Clearall
  293.    Edit PrinterTbl
  294.       Menu {Image} {Move} {PICK} Enter  ; Move selection field to left column
  295.       Scan
  296.          [PICK] = ""                    ; Remove previous default selection
  297.       Endscan
  298.       Home                              ; Return to first record
  299.       Moveto [PICK]
  300.    ;-- Define and center first and second lines of prompt statement
  301.    Prompt1 = Format("W80,AC","Using arrows to move around, place an X alongside the correct printer. (Press")
  302.    Prompt2 = Format("W80,AC","<Ins> key if it is not listed.)  Press <F2> key when finished, or <Esc> to quit.")
  303.    While True
  304.       Wait table
  305.          Prompt Prompt1, Prompt2
  306.       Until "F2", "Esc", "Ins", "Del", "DOS", "DOSBig"
  307.       Switch
  308.          Case RetVal = "F2"  :  Do_It!
  309.                                 Quitloop
  310.          Case RetVal = "Ins" :  Add_Printer()
  311.                                 QuitLoop
  312.          Case RetVal = "Del" :  Beep                         ;- Get the user's attention
  313.                                 Showmenu                     ;- show options
  314.                                    "Cancel": "Cancel Deletion:  Do not delete this record",
  315.                                    "Delete": "It is okay to delete this record"
  316.                                    To choice
  317.                                 If choice = "Delete"   ;- only delete record if confirmed
  318.                                    Then Del
  319.                                         Loop
  320.                                 Endif
  321.          Case RetVal = "Esc" :  CancelEdit
  322.                                 Clear ClearAll
  323.                                 Quit
  324.          Case RetVal =  15              ;- Trap for user entering Alt-O
  325.            or Retval = -24   :  Loop    ;- or Ctrl-O in error
  326.       EndSwitch
  327.    EndWhile
  328.    Reset {Ask} Select PrinterTbl "Delete"
  329.       Moveto [NAME] "Blank"
  330.    Do_It!
  331. Endproc
  332. Writelib Libname Select_Printer
  333. Release procs Select_Printer
  334. ?? ""
  335.  
  336. ;---- Complete descriptions of variables for prompt statement
  337. Proc Prompt_Descriptions()
  338.    Switch
  339.       Case PaperLength = "11" :  PaperLength = "letter"
  340.       Case PaperLength = "14" :  PaperLength = "legal"
  341.    EndSwitch
  342.    Switch  ; last parenthesis is added later (in prompt statement)
  343.       Case Upper(Pitch) = "CONDENSED" :  Pitch = "condensed print (16.6"
  344.                                          Font  = "16.6H"
  345.       Case Upper(Pitch) = "ELITE"     :  Pitch = "elite print (12"
  346.                                          Font  = "12.0H"
  347.       Case Upper(Pitch) = "PICA"      :  Pitch = "pica print (10"
  348.                                          Font  = "10.0H"
  349.    EndSwitch
  350.    If Upper(Orientation) = "PORTRAIT"
  351.       then Orientation = "portrait (vertical, as for a letter)"
  352.       else Orientation = "landscape (horizontal, or sideways)"
  353.    Endif
  354. Endproc
  355. Writelib Libname Prompt_Descriptions
  356. Release procs Prompt_Descriptions
  357. ?? ""
  358.  
  359. ; ---- Assign printer codes
  360. Proc Assign_PrinterCodes()
  361.    Reset {Ask} Select PrinterTbl
  362.       Moveto [NAME] "..\" I\""
  363.       Moveto [CODE] "Changeto 1" Down
  364.       Moveto [NAME] "..\" II\" or ..\" II-P\""
  365.       Moveto [CODE] "Changeto 2" Down
  366.       Moveto [NAME] "..\" III\""
  367.       Moveto [CODE] "Changeto 3" Down
  368.       Moveto [TYPE] "Dot Matrix"
  369.       Moveto [CODE] "Changeto 4"
  370.    Do_It!
  371. Endproc
  372. Writelib Libname Assign_PrinterCodes
  373. Release procs Assign_PrinterCodes
  374. ?? ""
  375.  
  376. ; ---- Delete blank records and check for missing fields
  377. Proc Required_Fields(Fieldname)
  378.    While true
  379.       Moveto Field Fieldname
  380.       If isblank([])
  381.          Then If Fieldname = "PORT"
  382.                  Then [PORT] = "LPT1"
  383.                  Else Fieldname = lower(Fieldname)
  384.                       Prompt1 = Format("W80,AC","You have not yet entered the " + Fieldname + ".  Please do so now")
  385.                       Prompt2 = Format("W80,AC","(or press the <Esc> key to cancel this edit session).")
  386.                       Wait Field
  387.                          Prompt Prompt1, Prompt2
  388.                       Until "Enter", "Esc", "F2"
  389.                       If retval = "Esc"
  390.                          then Del
  391.                               Clear Clearall
  392.                               Quit
  393.                       Endif
  394.               Endif
  395.          Else Quitloop
  396.       Endif
  397.    Endwhile
  398. Endproc
  399. Writelib Libname Required_Fields
  400. Release procs Required_Fields
  401. ?? ""
  402.  
  403. ; ---- Extract new printer codes designated by user
  404. Proc New_Codes()
  405.    View "Answer"
  406.            PrinterName = [NAME]
  407.            Orientation = [ORIENTATION]
  408.            Pitch       = [PITCH]
  409.            Port        = [PORT]
  410.            Setup       = [SETUP]
  411.            Length      = [LENGTH]
  412.            PrintType   = [CODE]
  413.    Confirm_Configuration()              ; simply setting the default printer
  414. Endproc
  415. Writelib Libname New_Codes
  416. Release procs New_Codes
  417. ?? ""
  418.  
  419. ; ---- Configure the printer
  420. Proc Configure_Printer()
  421.    Private Choice   ;- user's choice
  422.    Please_Wait("Please wait while information is being extracted")
  423.    While true
  424.       Reset {Ask} Select PrinterTbl CheckPlus
  425.          Moveto [PICK] "X"
  426.       Do_It!
  427.       If not isempty("Answer")
  428.          then New_Codes()
  429.               If YN = "YES"
  430.                  then Prompt_Descriptions()      ; determine the proper variables
  431.                       Assign_PrinterCodes()
  432.                       Quitloop
  433.                   else Loop
  434.               Endif
  435.          Else Select_Printer()
  436.               Loop
  437.       Endif
  438.       Quitloop
  439.       Reset {Ask} Select PrinterTbl "Delete"
  440.          Moveto [NAME] "Blank"
  441.       Do_It!
  442.    Endwhile
  443.    Please_Wait("Please wait while printer is being configured")
  444. Endproc
  445. Writelib Libname Configure_Printer
  446. Release procs Configure_Printer
  447. ?? ""
  448.  
  449. ; ---- Add new printer configuration to printer table
  450. Proc Add_Printer()
  451.    Pickform 1
  452.    End
  453.    CtrlPgDn
  454.    [ORIENTATION] = Orientation
  455.    [PITCH]       = Pitch
  456.    Prompt_Descriptions()
  457.    While True
  458.       Wait table
  459.          Prompt "Please enter the information for " + PaperLength + "-sized paper, " + Pitch,
  460.                 "characters per inch), and " + Orientation + " orientation."
  461.       Until "F2", "Esc", "Del", "DOS", "DOSBig"
  462.       Switch
  463.          Case RetVal = "F2"  :  NumRecs = Nrecords(PrinterTbl)
  464.                                 Required_Fields("NAME")
  465.                                 Required_Fields("LENGTH")
  466.                                 Required_Fields("TYPE")
  467.                                 Required_Fields("SETUP")
  468.                                 FormKey
  469.                                 Required_Fields("PORT")
  470.                                 If NumRecs >= NRecords(PrinterTbl)  ; If record was not deleted
  471.                                    Then [PICK] = "X"
  472.                                 Endif
  473.                                 Do_It!
  474.                                 Reset {Ask} Select PrinterTbl CheckPlus
  475.                                    Moveto [PICK] "X"
  476.                                 Do_It!
  477.                                 New_Codes()
  478.                                 QuitLoop
  479.          Case RetVal = "Del" :  Beep                   ;- Get the user's attention
  480.                                 Showmenu               ;- Trap for accidental deletions
  481.                                    "Cancel": " Cancel Deletion:  Do not delete this record",
  482.                                    "Delete": " It is okay to delete this record"
  483.                                    To choice
  484.                                 If choice = "Delete"   ;- only delete record if confirmed
  485.                                    Then Del
  486.                                         CtrlPgDn
  487.                                         CtrlHome
  488.                                         Loop
  489.                                 Endif
  490.          Case RetVal = "Esc" : CancelEdit
  491.                                Clear Clearall
  492.                                Quit
  493.          Case RetVal =  15            ;- Trap for user entering Alt-O
  494.            or Retval = -24   : Beep   ;- or Ctrl-O in error
  495.       EndSwitch
  496.       Quitloop
  497.    EndWhile
  498. Endproc
  499. Writelib Libname Add_Printer
  500. Release procs Add_Printer
  501. ?? ""
  502.  
  503. ; ---- If default configuration is assigned, have user confirm that it is correct
  504. Proc Confirm_Configuration()
  505.    While true
  506.       Cursor box
  507.       Clear Clearall
  508.       Paintcanvas Attribute 00 00, 00, 24, 79 Style Attribute 15 ; Draw black canvas
  509.       Paintcanvas Attribute 63 01, 06, 23, 71                    ; white on cyan
  510.       @ 00,06 ?? Fill("\220",67)                                 ; Use Ascii
  511.       @ 23,06 ?? Fill("\223",67)                                 ; characters
  512.       For X From 0 TO 21                                         ; to create frame:
  513.          @ (X+1), 06 ?? "\219"                                   ; 223 ▀
  514.          @ (X+1), 72 ?? "\219"                                   ; 219 █
  515.       EndFor                                                     ; 220 ▄
  516.       Style Attribute 63                                         ; White on cyan
  517.       @  2,10 ?? "Your reports have been configured with the following setup:"
  518.       Style Attribute 48                                         ; Black on cyan
  519.       @  5,15 ?? "PRINTER TYPE:  " + PrinterName
  520.       @  7,15 ?? "PORT:          " + Port
  521.       @  9,15 ?? "SETUP STRING:  " + Setup
  522.       @ 11,15 ?? "PAGE LENGTH:   " + Length
  523.       @ 13,15 ?? "PITCH:         " + Pitch
  524.       @ 15,15 ?? "ORIENTATION:   " + Orientation
  525.       Style Attribute 03
  526.       @ 21,12 ?? "Press the <Enter> key when finished (or <Esc> to quit)."
  527.       Style Attribute 15                            ; white on black
  528.       @ 18,10 ?? "Is this information correct?  Please answer Yes or No:  "      ; relates to the above question
  529.       Style Attribute 11 Accept "A3" Required picture "{YES,NO}" to YN
  530.       ; Return if user pressed Escape key ... Otherwise, process
  531.       If retval = False      ; Return if user pressed escape key
  532.          Then return
  533.          Else If YN = "YES"
  534.                  Then Update_ReportStrings()
  535.                       Quitloop
  536.                  Else Select_Printer()
  537.                       Quitloop
  538.               Endif
  539.       Endif
  540.       Quitloop
  541.    Endwhile
  542. Endproc
  543. Writelib Libname Confirm_Configuration
  544. Release procs Confirm_Configuration
  545. ?? ""
  546.  
  547. ; ---- automatically update all reports as specified by the user
  548. Proc Update_ReportStrings()
  549.    Please_Wait("Please wait while the reports are being configured")
  550.    Setdir Directory() ; delete all temporary tables
  551.    {Tools} {Info} {Inventory} {Files} {*.r*}
  552.    {Modify} {Restructure} {List} Down Del Down "Tbl" Enter "A8" Enter
  553.       "Reptnum" Enter "A3" Do_It!
  554.    While not isblank(Window())
  555.       Enter
  556.    Endwhile
  557.    Edit "List"
  558.       Scan
  559.          Fix = Match([Name],"..\".r\"..",Tbl,Reptnum)
  560.          If isblank(Reptnum)
  561.             then Reptnum = "R"
  562.          Endif
  563.          If Fix
  564.             then [Tbl]     = Tbl
  565.                  [Reptnum] = Reptnum
  566.          Endif
  567.       Endscan
  568.    Do_It!
  569.       View "List"
  570.       CurrentRecord = 1
  571.       While CurrentRecord <= NRecords("list")
  572.          Moveto Record CurrentRecord
  573.          Tbl     = [Tbl]
  574.          Reptnum = [Reptnum]
  575.          Menu {Report} {Change} Select Tbl Select Reptnum Select Menuchoice()
  576.             Menu {Setting} {PageLayout} {Length} CtrlBackSpace Typein Length Enter
  577.             Menu {Setting} {Setup} {Custom} Select Port CtrlBackSpace Typein Setup Enter
  578.          Do_It!
  579.          UpImage
  580.          CurrentRecord = (CurrentRecord + 1)
  581.          Loop
  582.    Endwhile
  583. Endproc
  584. Writelib Libname Update_ReportStrings
  585. Release procs Update_ReportStrings
  586. ?? ""
  587.  
  588. ; ---- Confirm type of printer designated by user
  589. Proc Check_Printer()
  590.    Private Keypressed, Prompt1, Prompt2, Prompt3, Prompt4,
  591.            Prompt5, Prompt6, Prompt7A, Prompt7B
  592.    While true
  593.       Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  594.       Reset {Ask} Select PrinterTbl CheckPlus
  595.          Moveto [PICK] "X"
  596.       Do_It!
  597.       Prompt1  = " Press any key when ready.  "
  598.       Prompt2  = "P R E S S    A N Y    K E Y    W H E N    R E A D Y"
  599.       Prompt3  = "Please fill "+PaperLength+"-sized paper tray and place in printer."
  600.       Prompt4  = "Locate buttons on right-hand panel."
  601.       Prompt5  = "Press the On-Line button until the light goes out."
  602.       Prompt6  = "Press the On-Line button until the light goes on."
  603.       Prompt7A = "Press the second button in from the left (labeled Reset) until the"
  604.       Prompt7B = "word Reset appears above."
  605.       If not Isempty("Answer")
  606.          Then View "Answer"
  607.                  Length = [LENGTH]
  608.                  Setup  = [SETUP]
  609.                  Port   = [PORT]
  610.                  Cursor off
  611.                  Clear Clearall
  612.               If not isblank(PrintType)
  613.                  Then Switch
  614.                          Case PrintType = "1" : Laser_Printer("I")
  615.                          Case PrintType = "2" : Laser_Printer("II")
  616.                          Case PrintType = "3" : Laser_Printer("III")
  617.                          Case PrintType = "4" : DotMatrix_Printer()
  618.                          Case PrintType = "5" : Miscellaneous_Printer()
  619.                       Endswitch
  620.                  Else Miscellaneous_Printer()
  621.               Endif
  622.          Else Quitloop
  623.       Endif
  624.       Clear Clearall
  625.       If not PrinterStatus()
  626.          Then Printer_Offline()
  627.          Else Please_Wait("Please wait while the reports are being configured")
  628.       Endif
  629.       Quitloop
  630.    Endwhile
  631.    Style Attribute 12  Beep
  632.    Cursor Normal
  633. Endproc
  634. Writelib Libname Check_Printer
  635. Release procs Check_Printer
  636. ?? ""
  637.  
  638. ; ---- Ascertain whether or not printer is online
  639. Proc Printer_Offline()
  640.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  641.    Draw_Box("Wide", 63, 03, 11, 21, 64, "", "")
  642.    @ 15,28 ?? "Turn on the printer."   ; if not, apprise user accordingly
  643.    Style attribute 48
  644.    @ 11,22 ?? "Please make sure that the printer"
  645.    @ 12,22 ?? "is filled with " + PaperLength + "-sized paper."
  646.    Draw_Box("Wide", 15, 06, 20, 08, 56, "", "")
  647.    Style attribute 139
  648.    @ 07,24 ?? "THE  PRINTER  IS  OFF - LINE!"
  649.    Style attribute 03
  650.    @ 18,24 ?? Prompt1
  651.    Keypressed = Getchar()
  652.    Please_Wait("Please wait while the reports are being configured")
  653. Endproc
  654. Writelib Libname Printer_Offline
  655. Release procs Printer_Offline
  656. ?? ""
  657.  
  658. ; ---- Provide on-screen instructions for using dot-matrix printer
  659. Proc DotMatrix_Printer()
  660.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  661.    Draw_Box("Wide", 63, 05, 06, 19, 70, "", "")   ; White on cyan
  662.    @ 13,28 ?? "Turn on the printer."
  663.    Style attribute 48                      ; Black on cyan
  664.    @ 08,13 ?? "Please make sure that the printer is filled with"
  665.    @ 09,13 ?? "paper, aligned with the perforation parallel to the"
  666.    @ 10,13 ?? "ribbon guide (just beneath the paper bail lever)."
  667.    Style Attribute 03  @ 16,25 ?? Prompt1
  668.    Style Attribute 131 @ 16,17 ?? "\07 \07 \07 \07 " @ 16,52 ?? " \07 \07 \07 \07"
  669.    Keypressed = Getchar()
  670. Endproc
  671. Writelib Libname DotMatrix_Printer
  672. Release procs DotMatrix_Printer
  673. ?? ""
  674.  
  675. ; ---- Provide on-screen instructions for printing with HP compatible laser jet
  676. Proc Laser_Printer(Series)
  677.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  678.    Draw_Box("Double", 04, 00, 00, 24, 79, 22, "")
  679.    Switch
  680.       Case Upper(Series) = "I" :
  681.            @ 10,04 ?? "\04"  @ 13,04 ?? "\04"  @ 18,04 ?? "\04"
  682.            Cross_Line("DoubleSingle",02,00,79)
  683.            Cross_Line("DoubleSingle",05,00,79)   Cross_Line("DoubleSingle",20,00,79)
  684.            Style Attribute 15                  ; White on black
  685.            @ 1,11 ?? Prompt3   @ 6,21 ?? Prompt4   @ 8,15 ?? Prompt5   @ 21,16 ?? Prompt6
  686.            Style Attribute 04                  ; Red on black
  687.            @  3,10 ?? "Insert a " + Font + " font cartridge.  (If your fonts do not have"
  688.            @  4,10 ?? "graphics capability, the reports will print without boxes.)"
  689.            Style Attribute 07                  ; Light grey on black
  690.            @ 10,08 ?? "Slowly press menu button on right; continue doing so until you see"
  691.            @ 11,08 ?? "the words FONT SOURCE."
  692.            @ 13,08 ?? "If the " + Font + " cartridge was inserted in the left side, the font"
  693.            @ 14,08 ?? "source is `L'; if in the right side, it is `R'.  Press the manual"
  694.            @ 15,08 ?? "button (located above the menu button) until the proper letter"
  695.            @ 16,08 ?? "appears."
  696.            @ 18,08 ?? Prompt7A                     @ 19,08 ?? Prompt7B
  697.       Otherwise :
  698.            If Upper(Series) = "II"
  699.               then SymSet   = "IBM - US"
  700.               else SymSet   = "PC - 8"
  701.            Endif
  702.            @ 08,03 ?? "\04"    @ 12,03 ?? "\04"    @ 16,03 ?? "\04"
  703.            Cross_Line("DoubleSingle",02,00,79)     Cross_Line("DoubleSingle",06,00,79)
  704.            Cross_Line("DoubleSingle",20,00,79)
  705.            @ 3,21 ?? Prompt4   @ 5,15 ?? Prompt5
  706.            Style Attribute 15  @ 1,11 ?? Prompt3  @ 21,16 ?? Prompt6  ; White on black
  707.            Style Attribute 07
  708.            @ 08,06 ?? "Slowly press Menu button on right; continue doing so until you see the"
  709.            @ 09,06 ?? "words FONT SRC.  If this does not read `I', hold down the Alt key and"
  710.            @ 10,06 ?? "press the +/- buttons until `I' appears.  Press the Enter button."
  711.            @ 12,06 ?? "Press menu button until you words FONT NUM.  If this does not read"
  712.            @ 13,06 ?? "`FONT NUM 00', hold down the Alt key and press the +/- buttons until"
  713.            @ 14,06 ?? "this appears.  Press the Enter button."
  714.            @ 16,06 ?? "Hold down Menu button until you see the words SYM SET.  If this does"
  715.            @ 17,06 ?? "not read `SYM SET = " + SymSet + "', press Alt/+- buttons until this appears."
  716.            @ 18,06 ?? "Press the Enter button."
  717.    EndSwitch
  718.    Paintcanvas Attribute 79 23, 01, 23, 78 Style Attribute 79  @ 23,15 ?? Prompt2
  719.    Style Attribute 192 @ 23,06 ?? "\04 \04 \04 \04" @ 23,68 ?? "\04 \04 \04 \04"
  720.    Keypressed = Getchar()
  721. Endproc
  722. Writelib Libname Laser_Printer
  723. Release procs Laser_Printer
  724. ?? ""
  725.  
  726. ; ---- provide on-screen instructions for using unknown printer
  727. Proc Miscellaneous_Printer()
  728.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  729.    Draw_Box("Double", 04, 01, 07, 23, 71, 21, "")
  730.    @ 12,14 ?? "\04"         @ 14,14 ?? "\04"
  731.    Cross_Line("DoubleSingle",07,07,71)   Cross_Line("DoubleSingle",17,07,71)
  732.    Style Attribute 07
  733.    @ 12,18 ?? "Check your printer manual for directions."
  734.    @ 14,18 ?? "If graphics fonts are unavailable, the reports "
  735.    @ 15,18 ?? "will simply be printed without boxes."
  736.    Style Attribute 15
  737.    @  3,14 ?? "Fill the printer with " + PaperLength + "-sized (8 1/2 x 11-inch)"
  738.    @  4,14 ?? "paper.  (If your printer has a ribbon guide, align"
  739.    @  5,14 ?? "the paper with the top edge parallel to the guide.)"
  740.    @  9,18 ?? "Set the printer for " + Pitch + "H)"
  741.    @ 10,18 ?? "(preferably with graphics capability)."
  742.    @ 19,15 ?? Prompt6
  743.    Paintcanvas Attribute 79 22, 08, 22, 70
  744.    Style Attribute 79  @ 22,16 ?? "P R E S S   A N Y   K E Y   W H E N   R E A D Y"
  745.    Style Attribute 192 @ 22,09 ?? "\07 \07 \07" @ 22,65 ?? "\07 \07 \07"
  746.    Keypressed = Getchar()
  747. Endproc
  748. Writelib Libname Miscellaneous_Printer
  749. Release procs Miscellaneous_Printer
  750. ?? ""
  751.  
  752. ; ---------------------------------------------------------------------------------------
  753. ;             SHOW MESSAGE TO PREVENT IMPATIENT USERS FROM WREAKING HAVOC
  754. ;  (A generic procedure utilized by the printer utility, but useful in any application.)
  755. ; ---------------------------------------------------------------------------------------
  756.  
  757. Proc Please_Wait(WaitMssg)                           ; Tell user what is happening
  758.    Cursor Off                                        ; Do not show cursor
  759.    Clear Clearall                                    ; Clear screen and canvas
  760.    PaintCanvas Attribute 00  00, 00, 24, 79          ; Draw black background
  761.    PaintCanvas Attribute 112 10, 07, 14, 75          ; Draw grey shadow
  762.    PaintCanvas Attribute 48  09, 04, 13, 73          ; Draw cyan box
  763.    Style Attribute 176                               ; Draw blinking black characters
  764.    @ 11,05 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  765.    @ 11,66 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  766.    Style Attribute 48                                ; Show black lettering
  767.    @ 11,13 ?? Format("AC,CC,W52",Strval(Waitmssg))   ; Center message (capitalizing
  768. Endproc                                              ; first letter of each word)
  769. Writelib Libname Please_Wait
  770. Release Procs Please_Wait
  771. ?? ""
  772.  
  773. ; ---------------------------------------------------------------------------------------
  774. ;                         DRAW A COLORED BOX AT GIVEN COORDINATES
  775. ;  (A generic procedure utilized by the printer utility, but useful in any application.)
  776. ; ---------------------------------------------------------------------------------------
  777.  
  778. Proc Draw_Box(LineType,BoxColor,StartRow,StartColumn,Endrow,EndColumn,FirstCross,NextCross)
  779.    Private FillNum,     ; Number of horizontal characters to fill in
  780.            X            ; A counter
  781.    ; --- Determine the number of horizontal characters to fill in between starting and ending
  782.    ;     columns
  783.    Fillnum = (EndColumn - StartColumn -1)
  784.    ; --- Determine appropriate character for each part of the box (e. g., for each type of
  785.    ;     line (single, double, and wide), the upper lefthand corner, upper right hand corner,
  786.    ;     lower left hand corner, lower right hand corner, horizontal, and vertical ... As the
  787.    ;     wide lines distinguish betwen horizontal "top" and "bottom" characters, both
  788.    ;     HorizontalTop and HorizontalBottom are cited.
  789.    Switch
  790.       Case Upper(LineType) = "SINGLE": UpperLeft     = "\218"   UpperRight       = "\191"
  791.                                        LeftCross     = "\195"   RightCross       = "\180"
  792.                                        LowerLeft     = "\192"   LowerRight       = "\217"
  793.                                        HorizontalTop = "\196"   HorizontalBottom = "\196"
  794.                                        Vertical      = "\179"
  795.       Case Upper(LineType) = "DOUBLE": UpperLeft     = "\201"   UpperRight       = "\187"
  796.                                        LeftCross     = "\204"   RightCross       = "\185"
  797.                                        LowerLeft     = "\200"   LowerRight       = "\188"
  798.                                        HorizontalTop = "\205"   HorizontalBottom = "\205"
  799.                                        Vertical      = "\186"
  800.       Case Upper(LineType) = "WIDE":   UpperLeft     = "\219"   UpperRight       = "\219"
  801.                                        LeftCross     = "\219"   RightCross       = "\219"
  802.                                        LowerLeft     = "\219"   LowerRight       = "\219"
  803.                                        HorizontalTop = "\223"   HorizontalBottom = "\220"
  804.                                        Vertical      = "\219"
  805.    EndSwitch
  806.    ; --- Specify the color in which to draw the box
  807.    PaintCanvas Attribute BoxColor StartRow, StartColumn, EndRow, EndColumn  Style Attribute BoxColor
  808.    ; --- At the designated coordinate, draw the top line of the box
  809.    @ StartRow, StartColumn ?? UpperLeft, Fill(HorizontalTop,FillNum), UpperRight
  810.    ; --- Fill in with vertical lines extending from the starting row to the ending row
  811.    For X From (StartRow + 1) to (EndRow - 1)
  812.       @ X,StartColumn ?? Vertical             ; Vertical lines at the "starting" column
  813.       @ X,EndColumn   ?? Vertical             ; Vertical lines at the "ending" column
  814.    EndFor
  815.    ; --- If applicable, add intersecting horizontal "crosslines"
  816.    If not isblank(FirstCross)
  817.       Then @ FirstCross, StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  818.            If not isblank(NextCross)
  819.               Then @ NextCross,  StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  820.            Endif
  821.    Endif
  822.    @ EndRow, StartColumn ?? LowerLeft, Fill(HorizontalBottom,FillNum), LowerRight
  823.  
  824. Endproc
  825. Writelib Libname Draw_Box
  826. Release procs Draw_Box
  827. ?? ""
  828.  
  829. ; --- If desired, an additional horizontal line may be drawn across the canvas (Since this is
  830. ;     the exception rather than the rule, it is separated from the "main" box-making
  831. ;     procedure to prevent wasting space with seldom- used variables)
  832. Proc Cross_Line(LineType,StartRow,StartColumn,EndColumn)
  833.    Private FillNum,       ; Number of characters to fill in
  834.            X              ; A counter
  835.    ; --- Determine the number of horizontal characters to fill in between starting and ending
  836.    ;     columns
  837.    Fillnum = (EndColumn - StartColumn -1)
  838.    ; --- Determine appropriate "crossline" character for each part of the box (e. g., for
  839.    ;     each type of line (single, double, and wide), the left-hand side character, the
  840.    ;     right-hand side character, and the horizontal character)
  841.    Switch
  842.       Case Upper(LineType) = "SINGLE"       : LeftCross       = "\195"   ; ├
  843.                                               HorizontalCross = "\196"   ; ─
  844.                                               RightCross      = "\180"   ; ┤
  845.       Case Upper(LineType) = "DOUBLE"       : LeftCross       = "\204"   ; ╠
  846.                                               HorizontalCross = "\205"   ; ═
  847.                                               RightCross      = "\185"   ; ╣
  848.       Case Upper(LineType) = "WIDE"         : LeftCross       = "\219"   ; █
  849.                                               HorizontalCross = "\223"   ; ▀
  850.                                               RightCross      = "\219"   ; █
  851.       Case Upper(LineType) = "DOUBLESINGLE" : LeftCross       = "\199"   ; ╟
  852.                                               HorizontalCross = "\196"   ; ─
  853.                                               RightCross      = "\182"   ; ╢
  854.    EndSwitch
  855.    ; --- At the designated coordinate, draw the specified line
  856.    @ StartRow, StartColumn ?? LeftCross, Fill(HorizontalCross,Fillnum), RightCross
  857. Endproc
  858. Writelib libname Cross_Line
  859. Release procs Cross_Line
  860. ?? ""
  861.  
  862. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  863. ; ║                                    EXAMPLE(S)                                        ║
  864. ; ║           This procedure should appear in two segments of your main menu:            ║
  865. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  866. ; ║  (1)  If all of the options in your main report menu have the same format,           ║
  867. ; ║       invoke the utility just before calling your main report menu (with variable    ║
  868. ; ║       PrintNow "Yes")                                                                ║
  869. ; ║                                                                                      ║
  870. ; ║       (This will prevent repeatedly asking the user to confirm printing              ║
  871. ; ║       configuration, as would be the case if the procedure were called before        ║
  872. ; ║       each report was printed.)                                                      ║
  873. ; ║                                                                                      ║
  874. ; ║       For example, to print Samples table report number 1, using vertical, letter-   ║
  875. ; ║       sized paper and standard print, with a table named printer in subdirectory     ║
  876. ; ║       Lookup:                                                                        ║
  877. ; ║            Autolib = "Print"                                                         ║
  878. ; ║            Setup_Printer("Portrait","Pica","11","Lookup\\Printer","Yes")             ║
  879. ; ║            Report "Samples" "1"                                                      ║
  880. ; ║                                                                                      ║
  881. ; ║       N. B.  Although it may appear more efficient to print the reports from         ║
  882. ; ║              within the setup procedure, this would have necessitated asking the     ║
  883. ; ║              user to confirm his printer and setup string for each and every         ║
  884. ; ║              report being printed.  For this reason, it was obviously avoided.       ║
  885. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  886. ; ║  (2)  The system's main or utility menu should include a separate "Change            ║
  887. ; ║       Configurations" option to enable users to define default printer settings      ║
  888. ; ║       with variable PrintNow "No")                                                   ║
  889. ; ║                                                                                      ║
  890. ; ║       As a separate (main or utility menu) option to define default printer          ║
  891. ; ║       configuratrions (with variable PrintNow "No")                                  ║
  892. ; ║                                                                                      ║
  893. ; ║       (For example, when a user receives a new printer or is given access to         ║
  894. ; ║       a LAN, he or she might want to enter the respective codes at that time,        ║
  895. ; ║       rather than waiting until it is time to print reports)                         ║
  896. ; ║                                                                                      ║
  897. ; ║       For example, to configure (but not yet print) horizontal reports, using        ║
  898. ; ║       condensed print and legal-sized paper, with a table named printer in the       ║
  899. ; ║       current directory:                                                             ║
  900. ; ║            Autolib = "Print"                                                         ║
  901. ; ║            Setup_Printer("Landscape","Condensed","14","Printer","No")                ║
  902. ; ╚══════════════════════════════════════════════════════════════════════════════════════╝
  903.  
  904. ;                                    VARIATION(S)
  905.  
  906. ;    Obviously, these procedures can be modified to accomodate your own setups and
  907. ;    methodology.
  908.  
  909. ;    If this utility is to be included in a timed application, ensure that it is
  910. ;    invoked during normal business hours.  (For example, an application set to
  911. ;    automatically run at midnight on the first day of each month would pause until
  912. ;    someone confirmed the configurations ...  It would therefore be more prudent to
  913. ;    instead incorporate this utility in a separate module set to run during business
  914. ;    hours on the last business day of the preceding month.)
  915.